package com.webinsky.folder.service;

import java.util.List;

import com.webinsky.common.proj.Lang;
import com.webinsky.folder.domain.Folder;
import com.webinsky.folder.domain.FolderArticle;
import com.webinsky.folder.domain.FolderFilter;
import com.webinsky.folder.domain.FolderIndex;
import com.webinsky.folder.domain.FolderIndexCounts;
import com.webinsky.folder.domain.FolderRelationshipSync;
import com.webinsky.folder.domain.FolderType;
import com.webinsky.folder.domain.Folders;

public interface FolderManagement {
	/**
	 * 新建文件夹
	 * @param type
	 * @param folder
	 */
	void addFolder(Folder folder);
	/**
	 * @param folders
	 * @param bookMode
	 */
	void addFolders(List<Folder> folders, int siteId, FolderType type);
	/**
	 * 更新
	 * @param folders
	 */
	void updateFolders(List<Folder> folders);
	/**
	 * @param relationSync
	 */
	void syncRelationship(FolderRelationshipSync relationSync);
	/**
	 * 删除文件夹
	 * @param folderId
	 */
	void deleteFolder(int folderId, FolderType type);
	/**
	 * 更新文件夹
	 * @param folder
	 */
	void changeFolderName(int folderId, FolderType type, String name);
	/**
	 * 添加文章到指定目录
	 * @param folderId
	 * @param type
	 * @param articles
	 */
	void addArtileToFolder(int folderId, FolderType type, List<FolderArticle> articles);
	/**
	 * 移动文章内容
	 * 
	 * @param arctileId
	 * @param sort
	 */
	void moveArtilePos(int siteId,int arctileId, int sort, FolderType type, int folderId);
	/**
	 * 移动文件夹
	 * @param folderId
	 * @param sort
	 * @param type
	 */
	void moveFolderPos(int folderId, int sort, FolderType type);
	/**
	 * 删除文章
	 * @param folerId
	 * @param type
	 * @param articleIds
	 */
	void deleteArticleFromFolder(int folerId, FolderType type, List<Integer> articleIds);
	/**
	 * 删除文章
	 * @param articleId
	 */
	void deleteArticleFromFolder(int articleId);
	/**
	 * 查找文件夹文章
	 * @param bookMode
	 * @param lang
	 * @return
	 */
	List<FolderIndex> getFolderIndex(int siteId, Lang lang);
	/**
	 * 查找文章(分页)
	 * 
	 * @return
	 */
	Folders getFoldersByFilter(FolderFilter filter);
	/**
	 * 
	 * @param ids
	 * @return
	 */
	Folders getFoldersByIds(List<Integer> ids, FolderType type);
	/**
	 * @return
	 */
	FolderIndexCounts getAllIndexes(Lang lang, int siteId);
	/**
	 * @param itemId
	 * @return
	 */
	List<Integer> getCatalogIdByItemId(int itemId, Lang lang, int siteId);
}
